package ar.com.digitalbricks.view.imprenta.cliente.action;

import org.springframework.beans.factory.annotation.Configurable;

import ar.com.digitalbricks.fwk.hbm.ActionTransactionSupportAbstract;
import ar.com.digitalbricks.imprenta.cliente.mgr.ClienteMgr;

import com.opensymphony.xwork2.Action;

@Configurable("crearCliente")
public class CrearCliente extends ActionTransactionSupportAbstract {
	private ClienteMgr clienteMgr;
	private String razonSocial;
	private String cuit;
	private String direccion;
	private String tipoIva;
	private String mail;
	private String id;
	
	public String execute() throws Exception {
		String id = this.getClienteMgr().crearCliente(this.getCuit(), this.getDireccion(), this.getMail(), this.getRazonSocial(), this.getTipoIva());
		this.setId(id);
		this.getCurrentTransaction().commit();
		return Action.SUCCESS;
	}

	public String getRazonSocial() {
		return this.razonSocial;
	}

	public void setRazonSocial(String razonSocial) {
		this.razonSocial = razonSocial;
	}

	public String getCuit() {
		return this.cuit;
	}

	public void setCuit(String cuit) {
		this.cuit = cuit;
	}

	public String getDireccion() {
		return this.direccion;
	}

	public void setDireccion(String direccion) {
		this.direccion = direccion;
	}

	public String getTipoIva() {
		return this.tipoIva;
	}

	public void setTipoIva(String tipoIva) {
		this.tipoIva = tipoIva;
	}

	public String getMail() {
		return this.mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public ClienteMgr getClienteMgr() {
		return this.clienteMgr;
	}

	public void setClienteMgr(ClienteMgr clienteMgr) {
		this.clienteMgr = clienteMgr;
	}
}
